package com.studerb.tasks;


public class FailingTask extends AbstractTask<Void, Void> {
    
    @Override protected Void doInBackground() throws Exception {
        for(int i = 0; i < 50; ++i){
            setMessage(i + " of " + 50);
            Thread.sleep(300);
            setProgress(i);
        }
        setMessage("Throwing Exception...");
        throw new Exception("FailingTask Exception");
    }

    @Override public void init() {
        logger.debug("Task Init()");
        this.title = "Failing Task";
        this.determinable = true;
        this.connectionNeeded = false;
    }

}
